<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>实验代码提示</title>
</head>
<body>
    <p>玩家1：小明</p>
    <script>
        const para = document.querySelector('p');
        para.addEventListener('click',updateName);
        function updateName(){
            let name = prompt('输入一个新的名字：');
            para.textContent = '玩家1：' + name;
        }
    </script>
</body>
</html>